package com.mcxx.modules.system.controller;


import com.mcxx.modules.system.service.IdcardValidateService;
import com.mcxx.service.DefaultRestService;
import com.yinhai.ta404.core.restservice.annotation.RestService;
import com.yinhai.ta404.core.validate.annotation.V;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;



@Validated
@Api("数据管理/身份证公安校验")
@RestService({"dataManage/idcardRemoteValidate/v2"})
public class IdcardValidateController extends DefaultRestService {

    private final static Logger logger = LoggerFactory.getLogger(IdcardValidateController.class);

    @Autowired
    private IdcardValidateService idcardValidateService;


    
    @PostMapping("getIdcardInfo")
    @ApiOperation("通过公安接口查询身份证信息")
    public void addRecord(@V("notnull")String name,@V("notnull")String idcard) throws InterruptedException {
        logger.info("通过公安接口查询身份证信息，参数：{},{}", name,idcard);
        String res = idcardValidateService.getIdcardInfo(idcard,name);
        setData(res);
        logger.info("通过公安接口查询身份证信息,结果:{}",res);
    }





}
